import request from '@/utils/request'

// 查询城市管理列表
export function listCity(query) {
  return request({
    url: '/system/city/list',
    method: 'get',
    params: query
  })
}

// 查询城市管理详细
export function getCity(cityCode) {
  return request({
    url: '/system/city/' + cityCode,
    method: 'get'
  })
}

// 新增城市管理
export function addCity(data) {
  return request({
    url: '/system/city',
    method: 'post',
    data: data
  })
}

// 修改城市管理
export function updateCity(data) {
  return request({
    url: '/system/city',
    method: 'put',
    data: data
  })
}

// 删除城市管理
export function delCity(cityCode) {
  return request({
    url: '/system/city/' + cityCode,
    method: 'delete'
  })
}


//查看城市发展指数
export function listDevelopmentIndex(cityCode) {
  if(cityCode){
    return request({
      url: '/system/DevelopmentIndex/list?cityCode=' + cityCode,
      method: 'get'
    })
  }else{
    return request({
      url: '/system/DevelopmentIndex/list',
      method: 'get'
    })
  }

}

//底部链接
export function listLinks(cityCode) {
  if (cityCode) {
    return request({
      url: '/system/links/list?cityCode=' + cityCode,
      method: 'get'
    })
  } else {
    return request({
      url: '/system/links/list',
      method: 'get'
    })
  }
}

//获取所有城市发展指数
export function listDevelopmentIndexAll(cityCode) {
  return request({
    url: '/system/DevelopmentIndex/listAllCity?cityCode=' + cityCode,
    method: 'get'
  })
}


//获取产业总揽指数
export function getCompositeIndex(cityCode){
  return request({
    url: '/system/CompositeIndex/list?pageNum=3&pageSize=10&cityCode='+cityCode,
    method: 'get'
  })
}


